You are here: Appendix H: Export/import scripts > Dataimport.pm

Dataimport.pm

Imports data into a new or existing workspace. Most commonly used for importing KDIF and KFIF data.

Syntax

./dataimport.pm <options>

Options
Option Description
--ask | -a
Ask before running every command.
--cleanup | -c
Clean up temp files.
--datadir=<dir> | -d=<dir>
Output data files to <dir>.
--docexist
Upload files to existing documents.
--file1=<file> | -1<file>

Data file 1.

--file2=<file> | -2<file>

Data file 2.

--linecountmod=<mod>
Line count modifier for errors.
--project=<projectfile> | -p=<projectfile>
Project (workspace) file to import .
--project=<projectid> | -p=<projectid>
Project (workspace) ID to import .
--root=<dir> | -r=<dir>
Root directory to import to.
--verbose | -v
Verbose output. Writes debug information to the debug log (by default, located at /var/tmp/krono-<host>-<port>/kronotest.log.<uid> or similar).
--yes | -y
Continue if errors occur.

Remarks

Whenever a KDIF or KFIF file is converted, input file errors are checked in the process. The user will have the option of aborting the operation (after the conversion and before the import) to check and fix any errors in the input files.

No archive or content files are explicitly referenced by this script, but their existence will be checked based on the input files. For example, if a data file documents.kdif is found at /path/to/data/documents.kdif, the data import script will check if a directory /path/to/data/documents.kdif.dir exists. If so, the resulting import will use this directory as the archive file.

Examples

./dataimport.pm –p pid -1 documents.kdif

Converts the KDIF input file to standard CSV (via kronocsv.pm) and imports it to the workspace with id pid.

./dataimport.pm –p projectfile.csv -1 documents.kdif

Imports a workspace CSV file, thereby creating a new workspace, and then converts and imports the KDIF file.

./dataimport.pm –p projectfile.csv -1 folders.kfif -2 documents.kdif

Imports a new workspace, converts and imports a KFIF file, and finally converts and imports a KDIF file.

Example of real world output from the script:

./dataimport.pm -p /data/project.csv -d /data/tmp -1 /data/folders.KFIF
-2 /data/docs.KDIF 

New project: 1168
/data/folders.KFIF is of format 'KFIF'
 - converting to /data/tmp/conv100303.2/conv.KFIF.7163.UUDNg.csv

The output files look like this:

    6924  Dec 10  /data/tmp/conv100303.2/conv.KFIF.7163.UUDNg.csv
       1  Dec 10  /data/tmp/conv100303.2/conv.KFIF.7163.UUDNg.csv.stderr

Ok to proceed ? y

Importing /data/tmp/conv100303.2/conv.KFIF.7163.UUDNg.csv to project 1168

...

/data/docs.KDIF is of format 'KDIF'
 - converting to /data/tmp/conv100303.2/conv.KDIF.7163.1jmAM.csv

The output files look like this:

 2002364  Dec 10  /data/tmp/conv100303.2/conv.KDIF.7163.1jmAM.csv
       1  Dec 10  /data/tmp/conv100303.2/conv.KDIF.7163.1jmAM.csv.stderr

Ok to proceed ? y

Importing /data/tmp/conv100303.2/conv.KDIF.7163.1jmAM.csv to project 1168

www.bluecieloecm.com